import request from '@/utils/request'

//  查询用户列表
export function getCurrentUserAllowUserType(params) {
  return request({
    url: '/business/system/sysUser/getCurrentUserAllowUserType',
    method: 'get',
    params
  })
}
//  查询用户列表
export function getSysUserList(params) {
  return request({
    url: '/business/system/sysUser/list',
    method: 'get',
    params
  })
}
//  获取用户详情
export function getSysUserInfoById(id){
  return request({
    url: `/business/system/sysUser/${id}`,
    method: 'get',
  })
}
//  增加用户
export function addSysUser(data) {
  return request({
    url: '/business/system/sysUser/add',
    method: 'post',
    data
  })
}

//  更新用户
export function updateSysUser(data) {
  return request({
    url:'/business/system/sysUser/update',
    method:'put',
    data
  })
}

//  删除用户
export function delSysUser(ids) {
  return request({
    url:`/business/system/sysUser/${ids}`,
    method:'delete',
  })
}
//  重置密码
export function resetPwd(params){
  return request({
    url: `/business/system/sysUser/resetPwd`,
    method: 'get',
    params
  })
}

// 获取可选择用户角色
export function getAllowSelectUserType() {
  return request({
    url: '/business/system/sysUser/getAllowSelectUserType',
    method: 'get',

  })
}

//  增加用户
export function setUserType(data) {
  return request({
    url: '/business/system/sysUser/setUserType',
    method: 'post',
    data
  })
}
